
<%@page import="java.util.List"%>
<%@page import="domain.model.user.User"%>

<h2> Invite Users</h2>
<div>${msg}</div>
		
<div id="queryContents">

<table border="1" style="border-collapse: collapse;">
	<tr>
		<th>Name</th>
		<th>&nbsp;</th>
	</tr>
	<%
		List<User> users = (List<User>)request.getAttribute("userList");
	
		if(users.isEmpty())
		{
			%>
			
			<h2>There are no users to invite</h2>
			
			<%
			
		}
		
		for(User user: users)
		{
	%>
		
		<tr>
			<td><%=user.getFirstName()%> <%=user.getLastName()%></td>
			<td>
			<form method="POST" action="">
				<!--  <a href="InviteUser?userId=<%=user.getId()%>&groupId=${groupId}&userversionForInvitation=<%=user.getVersion()%>">Invite</a> -->
				<input type="hidden" value="<%=user.getId()%>" name="userId" />
				<input type="hidden" value="${groupId}" name="groupId" />
				<input type="hidden" value="<%=user.getVersion()%>"  name="userversionForInvitation"/>
				<input type="submit" value="Invite"/>
			</form>
			</td>
		</tr>
		
	<%
		}
	%>
</table>

</div> <!--closing queryContents -->
